﻿namespace SPDeploy.Library.Processing.Processors
{
    using System;
    using System.Linq;
    using Data;
    using Helpers;
    using Library;
    using Microsoft.SharePoint.Administration;

    public class CentralAdminProcessor : ProcessorBase<CentralAdmin, SPWebApplication>
    {
        #region Properties: public

        public override string Name
        {
            get { return "CentralAdmin"; }
        }

        #endregion

        #region Methods: public

        public override SPWebApplication Install(ProcessorContext ctx, CentralAdmin config)
        {
            Log(LogSeverity.Step, "Looking up Central Admin");
            return SPWebService.AdministrationService.WebApplications.First();
        }

        public override SPWebApplication Uninstall(ProcessorContext ctx, CentralAdmin config)
        {
            Log(LogSeverity.Step, "Looking up Central Admin");
            return SPWebService.AdministrationService.WebApplications.First();
        }

        public override SPWebApplication Update(ProcessorContext ctx, CentralAdmin oldConfig, CentralAdmin newConfig)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}